{-# OPTIONS -Wall #-}

--------------------------------------------------------------------------------
-- |
-- Module      :  HydroData
--
-- Demo data
-- 
--------------------------------------------------------------------------------

module HydroData
  ( 
    bad_example
  , ai_001
  , an_001
  , be_001
  , be_002
  , ca_001
  , br_001
  , gr_001
  , li_001
  , me_001
  , no_001
  , pe_001
  , po_001
  , sc_001
  , st_001
  , st_002
  , va_001

  ) where

import HydroConfig

bad_example :: HydroConfig
bad_example = HydroConfig
    { site_name         = "bad example (should fail)"
    , monitored_asset   = "ww"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER_PLUS
        , sensor_mode               = MODE_OTHER 2
        , sensor_material           = Just MATERIAL_SOLID
        , sensor_original_units     = UNIT_CENTIMETERS
        , sensor_empty_distance     = 2.0
        , sensor_span               = 2.3
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, CalibRelay   RELAY_FIXED_DUTY_ASSIST 1.0 0.35)
                        , (2, CalibRelay   RELAY_LEVEL_ALARM       1.0 1.1)
                        , (5, UncalibRelay RELAY_LOSS_OF_ECHO)
                        , (6, UncalibRelay RELAY_PUMP_EFFICIENCY)
                        ]




--------------------------------------------------------------------------------
-- A

ai_001 :: HydroConfig
ai_001 = HydroConfig
    { site_name         = "ai_001"
    , monitored_asset   = "ww"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER_PLUS
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Just MATERIAL_LIQUID
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 2.5
        , sensor_span               = 2.17
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, CalibRelay   RELAY_FIXED_DUTY_ASSIST 1.0 0.35)
                        , (2, CalibRelay   RELAY_LEVEL_ALARM       1.2 1.1)
                        , (5, UncalibRelay RELAY_PUMP_EFFICIENCY)
                        ]


an_001 :: HydroConfig
an_001 = HydroConfig
    { site_name         = "an_001"
    , monitored_asset   = "ww"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER_PLUS
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Just MATERIAL_LIQUID
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 3.8
        , sensor_span               = 3.5
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, CalibRelay  RELAY_ALT_DUTY_BACKUP 1.0 0.6)
                        , (2, CalibRelay  RELAY_ALT_DUTY_BACKUP 1.2 0.6)
                        , (5, UncalibRelay RELAY_LOSS_OF_ECHO)
                        ]

--------------------------------------------------------------------------------
-- B

be_001 :: HydroConfig
be_001 = HydroConfig
    { site_name         = "be_001"
    , monitored_asset   = "ww"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Nothing
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 4.88
        , sensor_span               = 4.58
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, CalibRelay  RELAY_ALT_DUTY_ASSIST 1.0 0.4)
                        , (2, CalibRelay  RELAY_ALT_DUTY_ASSIST 1.1 0.4)
                        , (5, UncalibRelay RELAY_LOSS_OF_ECHO)
                        ]

be_002 :: HydroConfig
be_002 = HydroConfig
    { site_name         = "be_002"
    , monitored_asset   = "sw"
    , sensor            = Sensor
        { sensor_type               = MULTIRANGER_200
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Just MATERIAL_LIQUID
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 4.7
        , sensor_span               = 4.4
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, CalibRelay  RELAY_ALT_DUTY_ASSIST 1.6  0.5)
                        , (2, CalibRelay  RELAY_ALT_DUTY_ASSIST 1.65 0.5)
                        ]


br_001 :: HydroConfig
br_001 = HydroConfig
    { site_name         = "br_001"
    , monitored_asset   = "cw"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER_200
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Just MATERIAL_LIQUID
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 2.39
        , sensor_span               = 2.09
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (2, CalibRelay  RELAY_LEVEL_ALARM 1.58 1.48)
                        , (3, CalibRelay  RELAY_LEVEL_ALARM 0.94 0.84)
                        , (6, UncalibRelay RELAY_LOSS_OF_ECHO)
                        ]

--------------------------------------------------------------------------------
-- C

ca_001 :: HydroConfig
ca_001 = HydroConfig
    { site_name         = "ca_001"
    , monitored_asset   = "ww"
    , sensor            = Sensor
        { sensor_type               = MULTIRANGER_PLUS
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Nothing
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 5.36
        , sensor_span               = 5.06
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, CalibRelay  RELAY_ALT_DUTY_BACKUP 1.0 0.2)
                        , (2, CalibRelay  RELAY_ALT_DUTY_BACKUP 1.1 0.2)
                        , (3, CalibRelay  RELAY_FIXED_DUTY_ASSIST 2.2 0.9)
                        , (4, UncalibRelay RELAY_LOSS_OF_ECHO)
                        , (5, UncalibRelay RELAY_LOSS_OF_ECHO)
                        ]

--------------------------------------------------------------------------------
-- G

gr_001 :: HydroConfig
gr_001 = HydroConfig
    { site_name         = "gr_001"
    , monitored_asset   = "cw"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Nothing
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 3.4
        , sensor_span               = 3.1
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, CalibRelay  RELAY_FIXED_DUTY_ASSIST 1.2  1.15)
                        , (2, CalibRelay  RELAY_FIXED_DUTY_ASSIST 2.55 2.5)
                        , (5, UncalibRelay RELAY_LOSS_OF_ECHO)
                        ]


--------------------------------------------------------------------------------
-- L

li_001 :: HydroConfig
li_001 = HydroConfig
    { site_name         = "li_001"
    , monitored_asset   = "ww"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER_PLUS
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Just MATERIAL_LIQUID
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 6.0
        , sensor_span               = 5.02
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, CalibRelay  RELAY_FIXED_DUTY_ASSIST 1.8  1.3)
                        , (2, CalibRelay  RELAY_FIXED_DUTY_ASSIST 1.9  1.3)
                        , (3, CalibRelay  RELAY_ALT_DUTY_ASSIST   2.0  1.95)
                        , (4, CalibRelay  RELAY_LEVEL_ALARM       3.0  2.9)
                        , (5, UncalibRelay RELAY_LOSS_OF_ECHO)
                        ]

--------------------------------------------------------------------------------
-- M

me_001 :: HydroConfig
me_001 = HydroConfig
    { site_name         = "me_001"
    , monitored_asset   = "mh"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Nothing
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 0.7
        , sensor_span               = 0.4
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, CalibRelay  RELAY_FIXED_DUTY_ASSIST 0.1  0.05)
                        , (5, UncalibRelay RELAY_LOSS_OF_ECHO)
                        ]


--------------------------------------------------------------------------------
-- N

no_001 :: HydroConfig
no_001 = HydroConfig
    { site_name         = "no_001"
    , monitored_asset   = "ww"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Nothing
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 5.8
        , sensor_span               = 5.5
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, UncalibRelay RELAY_NOT_IN_USE)
                        , (2, CalibRelay  RELAY_FIXED_DUTY_ASSIST 1.4 0.95 )
                        , (3, CalibRelay  RELAY_FIXED_DUTY_ASSIST 1.5 0.95 )
                        , (4, CalibRelay  RELAY_FIXED_DUTY_ASSIST 1.2 0.95 )
                        , (5, CalibRelay  RELAY_FIXED_DUTY_ASSIST 1.2 0.95 )
                        ]


--------------------------------------------------------------------------------
-- P

pe_001 :: HydroConfig
pe_001 = HydroConfig
    { site_name         = "pe_001"
    , monitored_asset   = "ww"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Nothing
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 1.83
        , sensor_span               = 1.53
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, CalibRelay  RELAY_ALT_DUTY_ASSIST 0.4   0.275 )
                        , (2, CalibRelay  RELAY_ALT_DUTY_ASSIST 0.425 0.275 )
                        , (4, CalibRelay  RELAY_LEVEL_ALARM     1.1 0.8 )
                        , (5, UncalibRelay RELAY_LOSS_OF_ECHO )
                        ]


po_001 :: HydroConfig
po_001 = HydroConfig
    { site_name         = "po_001"
    , monitored_asset   = "ww"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER_PLUS
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Just MATERIAL_LIQUID
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 2.52
        , sensor_span               = 2.0
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, CalibRelay  RELAY_ALT_DUTY_BACKUP 1.0   0.45 )
                        , (2, CalibRelay  RELAY_ALT_DUTY_BACKUP 1.05  0.45 )
                        , (4, CalibRelay  RELAY_LEVEL_ALARM     1.647 1.412 )
                        , (5, UncalibRelay RELAY_LOSS_OF_ECHO )
                        ]

--------------------------------------------------------------------------------
-- S

sc_001 :: HydroConfig
sc_001 = HydroConfig
    { site_name         = "sc_001"
    , monitored_asset   = "cw"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Nothing
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 3.22
        , sensor_span               = 2.92
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, CalibRelay  RELAY_FIXED_DUTY_ASSIST 1.0 0.9 )
                        , (2, CalibRelay  RELAY_FIXED_DUTY_ASSIST 1.5 1.4 )
                        , (4, CalibRelay  RELAY_LEVEL_ALARM       1.5 1.4 )
                        , (5, UncalibRelay RELAY_LOSS_OF_ECHO)
                        ]



st_001 :: HydroConfig
st_001 = HydroConfig
    { site_name         = "st_001"
    , monitored_asset   = "ww"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Nothing
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 4.25
        , sensor_span               = 3.95
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, CalibRelay  RELAY_ALT_DUTY_ASSIST   1.7 0.42 )
                        , (2, CalibRelay  RELAY_ALT_DUTY_ASSIST   1.8 0.42 )
                        , (3, CalibRelay  RELAY_FIXED_DUTY_ASSIST 1.5 1.2 )
                        , (4, UncalibRelay RELAY_NOT_IN_USE)
                        , (5, UncalibRelay RELAY_NOT_IN_USE)
                        ]


st_002 :: HydroConfig
st_002 = HydroConfig
    { site_name         = "st_002"
    , monitored_asset   = "sw"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Nothing
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 4.25
        , sensor_span               = 3.95
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, UncalibRelay RELAY_NOT_IN_USE)
                        , (2, CalibRelay   RELAY_ALT_DUTY_ASSIST 2.1 0.7 )
                        , (3, CalibRelay   RELAY_ALT_DUTY_ASSIST 2.4 0.7 )
                        , (4, UncalibRelay RELAY_NOT_IN_USE)
                        , (5, CalibRelay   RELAY_ALT_DUTY_ASSIST 2.5 0.75 )
                        ]



--------------------------------------------------------------------------------
-- V

va_001 :: HydroConfig
va_001 = HydroConfig
    { site_name         = "va_001"
    , monitored_asset   = "cw"
    , sensor            = Sensor
        { sensor_type               = HYDRORANGER
        , sensor_mode               = MODE_LEVEL
        , sensor_material           = Nothing
        , sensor_original_units     = UNIT_METERS
        , sensor_empty_distance     = 2.26
        , sensor_span               = 1.96
        , sensor_relays             = relays
        }
    }
  where
    relays = makeRelays [ (1, CalibRelay   RELAY_FIXED_DUTY_ASSIST 0.8 0.7)
                        , (2, CalibRelay   RELAY_LEVEL_ALARM       1.3 1.0 )
                        , (5, UncalibRelay RELAY_LOSS_OF_ECHO )
                        ]

